﻿@model EnetaMvc.Web.Models.ArticleEditModel

@{
    ViewBag.Title = "Edit";
    Layout = "~/Views/Shared/_NewsLayout.cshtml";
}
@section Header 
{
    <link href="@Url.Content("~/Content/jquery.cleditor.css")" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(document).ready(function ()
        {
            $("#Article_Body").cleditor();
        });
    </script>
}
<div class="blog-head">
	<div class="blog-head-txt">
		<h2 style="float: left">@Resources.EnetaMvc.Articles</h2>
	</div>
</div>

@Html.ValidationSummary()
@Html.ShowSuccessMessage((string)ViewBag.SuccessMessage)

<div class="enter-information">
    @{ Html.BeginForm(); }
        @if (Model.Article != null)
        {
            @Html.HiddenFor(m => m.Article.Id)
        }
        else
        {
            @Html.Hidden("Id", "0");
        }

        <fieldset>
            <div class="input-holder profile">
                <div class="info-row">
					@Html.ValidationMessageFor(m => m.Article.Title)
					<div class="title">
						<h5>@Resources.EnetaMvc.ArticleTitle</h5>
					</div>
					<div class="error-note"> <span>*</span> </div>
					<div class="information-main">
                        @Html.TextBoxFor(m => m.Article.Title, new Dictionary<string, object> { { "class", "text-go" } })
                    </div>
				</div>
                <div class="info-row">
					@Html.ValidationMessageFor(m => m.Article.Abstract)
					<div class="title">
						<h5>@Resources.EnetaMvc.ArticleAbstract</h5>
					</div>
					<div class="error-note"> <span>*</span> </div>
					<div class="information-main">
                        @Html.TextAreaFor(m => m.Article.Abstract, new Dictionary<string, object> { { "class", "text-go" } })
                    </div>
				</div>
                <div class="info-row">
					@Html.ValidationMessageFor(m => m.Article.Body)
					<div class="title">
						<h5>@Resources.EnetaMvc.ArticleBody</h5>
					</div>
					<div class="error-note"> <span>*</span> </div>
					<div class="information-main">
                        @Html.TextAreaFor(m => m.Article.Body, new Dictionary<string, object> { { "class", "text-go" } })
                    </div>
				</div>
                <div class="info-row">
					<div class="title">
						<h5>@Resources.EnetaMvc.Created</h5>
					</div>
					<div class="information-main">
                        @if (Model != null)
                        {
                            <span>@Model.Article.Created</span>
                        }
                    </div>
				</div>
                <div class="info-row">
					<div class="title">
						<h5>@Resources.EnetaMvc.CreatedBy</h5>
					</div>
					<div class="information-main">
                        @if (Model != null)
                        {
                            <span>@Model.Article.CreatedByUserName</span>
                        }
                    </div>
				</div>
                <div class="info-row">
					<div class="title">
						<h5>@Resources.EnetaMvc.PublishStateBy</h5>
					</div>
					<div class="information-main">
                        @if (Model != null)
                        {
                            <span>@Model.Article.PublishStateByUserName</span>
                        }
                    </div>
				</div>
                @if (!User.IsInRole("Administrator"))
                {
                    <div class="info-row">
						<div class="title">
							<h5>@Resources.EnetaMvc.PublishState</h5>
						</div>
						<div class="information-main">
                            @if (Model != null)
                            {
                                <span>@Model.Article.PublishStateName</span>
                            }
                        </div>
					</div>
                    <div class="info-row">
						<div class="title">
							<h5>@Resources.EnetaMvc.PublishComment</h5>
						</div>
						<div class="information-main">
                            @if(Model != null)
                            {
                                <span>@Model.Article.PublishComment</span>
                            }
                        </div>
					</div>
                }
                else
                {
                    <div class="info-row">
						<div class="title">
							<h5>@Resources.EnetaMvc.PublishState</h5>
						</div>
						<div class="information-main">
                            @if (Model != null)
                            {
                                @Html.DropDownListFor(m => m.Article.PublishStateId, Model.PublishStates)
                            }
                            else
                            {
                                @Html.DropDownListFor(m => m.Article.PublishStateId, Model.PublishStates)
                            }
                        </div>
					</div>
                    <div class="info-row">
                        @Html.ValidationMessageFor(m => m.Article.PublishComment)
						<div class="title">
							<h5>@Resources.EnetaMvc.PublishComment</h5>
						</div>
                        @*<div class="error-note"> <span>*</span> </div>*@
						<div class="information-main">
                            
                            @Html.TextBoxFor(m => m.Article.PublishComment, new Dictionary<string,object> { {"class","text-go"} })
                        </div>
					</div>
                }
            </div>
            <div class="submit">
				<input type="submit" value="@Resources.EnetaMvc.Save"/>
			</div>
			<a class="loobu" href="@Url.Content("~/news/articles/")">@Resources.EnetaMvc.Cancel</a>
            <p style="display:block;clear: both">&nbsp;</p>
       </fieldset>
    @{ Html.EndForm(); }
</div>
